
<%@ page import="dao.IBoardDao" %>
<%@ page import="Impl.BoardDaoImpl" %>
<%@ page import="entity.Board" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/4/3
  Time: 18:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>main</title>
</head>
<body background="pic/ManBgroud.gif">
<%
    IBoardDao ibo = new BoardDaoImpl();
    List<Board> list = ibo.showAll();

%>
<div style="margin: 0px auto;width: 600px">
    <form action="addnews_action.jsp" enctype="multipart/form-data" method="post">
        <h2>新闻添加</h2>
        <strong> 新闻版块:</strong>
        <select name="boardid">
            <%
                for (Board b:list) {
            %>

          <option  value="<%=b.getBoardId()%>"><%=b.getBoardName()%></option>

            <%
                }
            %>
        </select>
<br>
        <strong>要添加的新闻名字:</strong><input style="width: 300px" type="text" name="title" value=""><br>
        <strong>要添加的新闻内容:</strong><br><textarea name="context" id="" cols="30" rows="10"></textarea><br>
        <strong>要添加的新闻图片:</strong><input type="file" name="pic"><br>
        <input type="submit" name="sou" value="确认添加">
    </form>
</div>
</body>
</html>
